added some development tools
[windows-sources.git] / developer / Samples / NET 4.6 / FileBrowser / Shell / Interfaces / IShellFolder.cs
blob93ac28b515b08049bec150b84abc37c62ed4c107
1 using System;
2 using System.Runtime.InteropServices;
4 namespace ShellDll
6 [ComImport]
7 [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
8 [Guid("000214E6-0000-0000-C000-000000000046")]
9 public interface IShellFolder
11 // Translates a file object's or folder's display name into an item identifier list.
12 // Return value: error code, if any
13 [PreserveSig]
14 Int32 ParseDisplayName(
15 IntPtr hwnd,
16 IntPtr pbc,
17 [MarshalAs(UnmanagedType.LPWStr)]
18 string pszDisplayName,
19 ref uint pchEaten,
20 out IntPtr ppidl,
21 ref ShellAPI.SFGAO pdwAttributes);
23 // Allows a client to determine the contents of a folder by creating an item
24 // identifier enumeration object and returning its IEnumIDList interface.
25 // Return value: error code, if any
26 [PreserveSig]
27 Int32 EnumObjects(
28 IntPtr hwnd,
29 ShellAPI.SHCONTF grfFlags,
30 out IntPtr enumIDList);
32 // Retrieves an IShellFolder object for a subfolder.
33 // Return value: error code, if any
34 [PreserveSig]
35 Int32 BindToObject(
36 IntPtr pidl,
37 IntPtr pbc,
38 ref Guid riid,
39 out IntPtr ppv);
41 // Requests a pointer to an object's storage interface.
42 // Return value: error code, if any
43 [PreserveSig]
44 Int32 BindToStorage(
45 IntPtr pidl,
46 IntPtr pbc,
47 ref Guid riid,
48 out IntPtr ppv);
50 // Determines the relative order of two file objects or folders, given their
51 // item identifier lists. Return value: If this method is successful, the
52 // CODE field of the HRESULT contains one of the following values (the code
53 // can be retrived using the helper function GetHResultCode): Negative A
54 // negative return value indicates that the first item should precede
55 // the second (pidl1 < pidl2).
57 // Positive A positive return value indicates that the first item should
58 // follow the second (pidl1 > pidl2). Zero A return value of zero
59 // indicates that the two items are the same (pidl1 = pidl2).
60 [PreserveSig]
61 Int32 CompareIDs(
62 IntPtr lParam,
63 IntPtr pidl1,
64 IntPtr pidl2);
66 // Requests an object that can be used to obtain information from or interact
67 // with a folder object.
68 // Return value: error code, if any
69 [PreserveSig]
70 Int32 CreateViewObject(
71 IntPtr hwndOwner,
72 Guid riid,
73 out IntPtr ppv);
75 // Retrieves the attributes of one or more file objects or subfolders.
76 // Return value: error code, if any
77 [PreserveSig]
78 Int32 GetAttributesOf(
79 uint cidl,
80 [MarshalAs(UnmanagedType.LPArray)]
81 IntPtr[] apidl,
82 ref ShellAPI.SFGAO rgfInOut);
84 // Retrieves an OLE interface that can be used to carry out actions on the
85 // specified file objects or folders.
86 // Return value: error code, if any
87 [PreserveSig]
88 Int32 GetUIObjectOf(
89 IntPtr hwndOwner,
90 uint cidl,
91 [MarshalAs(UnmanagedType.LPArray)]
92 IntPtr[] apidl,
93 ref Guid riid,
94 IntPtr rgfReserved,
95 out IntPtr ppv);
97 // Retrieves the display name for the specified file object or subfolder.
98 // Return value: error code, if any
99 [PreserveSig()]
100 Int32 GetDisplayNameOf(
101 IntPtr pidl,
102 ShellAPI.SHGNO uFlags,
103 IntPtr lpName);
105 // Sets the display name of a file object or subfolder, changing the item
106 // identifier in the process.
107 // Return value: error code, if any
108 [PreserveSig]
109 Int32 SetNameOf(
110 IntPtr hwnd,
111 IntPtr pidl,
112 [MarshalAs(UnmanagedType.LPWStr)]
113 string pszName,
114 ShellAPI.SHGNO uFlags,
115 out IntPtr ppidlOut);